package com.pdwl.cashoutpay.controller;

import com.pdwl.cashoutpay.util.ContanGobal;
import com.pdwl.cashoutpay.util.HttpUtil;
import com.pdwl.cashoutpay.util.Sign;
import com.pdwl.cashoutpay.util.TimeUtil;
import net.sf.json.JSONObject;


public class TestDemo1 {

    public static void main(String[] args) throws Exception {

//        /**
//         * 商户注册接口
//         * */
//
//        String url = "https://docker.pandong.xin/cashoutpay/merchant/create";
//        String url = "https://f.pandong.xin/cashoutpay/merchant/create";
        String url = "http://127.0.0.1:8082/merchant/create";
//        商户报备信息
        JSONObject payReq = new JSONObject();
        payReq.put("contactMobile", "15372075669"); //联系人手机号
        payReq.put("contactAdress", "浙江省杭州市下城区绍兴路337号"); //联系人地址
        payReq.put("pMercId", "201803001"); //接入商商户号
        payReq.put("merchCode", "2018032122111"); //接入商二级商户号
        payReq.put("accNo", "62122612110025884010"); //银行卡卡号
        payReq.put("accName", "苏晓鹏"); //银行卡的开户人姓名
        payReq.put("openBank", "工商银行"); //开户行
        payReq.put("bankCode", "ICBC"); //开户行简称
        payReq.put("alliedBankCode", "102337104253"); //联行号
        payReq.put("tradeRate", "0.0047"); //商户费率
        payReq.put("remitFee", "1"); //出款手续费（每笔)
        payReq.put("merchantNotifyUrl", "https://ae83a2ea.ngrok.io/test/lifeMerchant"); //商户通知url
        payReq.put("certNo", "332525199501304517"); //证件号

        payReq.put("sign", Sign.getSign(payReq));


        String res = HttpUtil.httpRequest(url, "POST", payReq.toString());
        System.out.println("收到数据" + res);


//        /**
//         * 短信消费接口
//         * */
//        String url = "https://docker.pandong.xin/cashoutpay/fastPayRouter/consumeSMS";
//        //短信消费
//        JSONObject payReq = new JSONObject();
//        payReq.put("outMerchantCode","665488972454123420180319164233");
//        payReq.put("orderNo", TimeUtil.getTime("yyyyMMddHHmmss")); //商户订单号
//        payReq.put("amount", "500.1"); //交易金额
//        payReq.put("notifyUrl", "https://cf54fcd0.ngrok.io/test/costMail"); //回调地址
//        payReq.put("criditNo", "XXXXXXXXXXX"); //信用卡号
//        payReq.put("bankPhoneNo", "15372075669"); //银行卡预留手机
//        payReq.put("cvv","XXXXX");
//        payReq.put("expireDate", "yyMM"); //有效期   yyMM
//        payReq.put("sign", Sign.getSign(payReq));
//        String sendStr=payReq.toString();
//
//        String res = HttpUtil.httpRequest(url, "POST",sendStr);
//        System.out.println("收到数据" + res);


        /**
         * 短信验证接口
         * */
//        String url="https://docker.pandong.xin/cashoutpay/mailCheck/check";

////        商户报备信息
//        JSONObject payReq = new JSONObject();
//        payReq.put("ourOrderId", "2018031916485020180319164851"); //商户订单号
//        payReq.put("smsCode", "652497"); //短信验证码
//        payReq.put("sign", Sign.getSign(payReq));
//        String sendStr=payReq.toString();
//        String res = HttpUtil.httpRequest(url, "POST",sendStr);
//        System.out.println("收到数据"+res);

        /**
         * 订单查询接口
         * */
//        String url = "https://docker.pandong.xin/cashoutpay/query/tradeQuery";
//
//        JSONObject payReq = new JSONObject();
//        payReq.put("orderId", "20180319164850"); //商户订单号
////        payReq.put("ourOrderId", "2018031916485020180319164851"); //商户订单号
//        String res = HttpUtil.httpRequest(url, "POST",payReq.toString());
//        System.out.println("收到数据"+res);

    }

}
